<div class='CartWrap'>
    <div class="CartNav clearfix">
    <div class="floatLeft">
    <img src="statics/cartnav-step4.gif" alt="Shopping Process - Confirm Order Fill Shopping" />
    </div>
    <div class="floatRight"><img src="statics/cartnav-cart.gif"  /></div>
    </div>
</div>
<form id="f_order_pay" target="_blank" action='<{link ctl="paycenter" act="order"}>' method="post">
<input type="hidden" name="order_id" value="<{$order.order_id}>" />
<input type="hidden" name="money" value="<{$order.amount.total-$order.amount.payed}>" id="hidden_money"/>
<input type="hidden" name="currency" value="<{$order.currency}>" />
<input type="hidden" name="cur_money" value="<{$order.cur_money }>" id="hidden_cur_money"/>
<input type="hidden" name="cur_rate" value="<{$order.cur_rate }>" />
<input type="hidden" name="cur_def" value="<{$order.cur_def }>" /> 

<div class="success clearfix pushdown-2">
   <h3>Congratulations! Your order has been submitted!</h3>
 
</div>






<h3>Order Information</h3>
  <div class='ColColorBlue' style='padding:5px;border:1px #ccc solid;'>
      <span><{t}>Order number:<{/t}></span><strong class='font14px'><{$order.order_id}></strong>&nbsp;&nbsp;[ <a href="<{link ctl=order act=detail arg0=$order.order_id}>" >View order details &raquo;</a> ]
  </div>
  <div class='division' style='padding:15px;'>
     <span><{t}>Order Amount:<{/t}></span><strong class="hueorange fontcolorRed font20px" id="span_amount"><{$order.amount.total-$order.amount.payed|cur:$order.currency}></strong>
  </div>
  

<h3>Order to pay</h3>
<{if $order.amount.total > $order.amount.payed}>
  <div class='ColColorBlue' style='padding:5px;border:1px #ccc solid;'>
      <{if !$order.selecttype}>
        <{t}>You have selected:<{/t}><strong class="hueorange fontcolorRed font14px"><{$order.paymethod}></strong>
         <a href='<{link ctl=order act=index arg0=$order.order_id arg1=true}>' >[ Choose other payment methods ]</a>
      <{else}>
         <{t}>Please select payment method:<{/t}>
     <{/if}>
  </div>
  <{/if}>
  <div class='division'>
  
  <{if $order.selecttype}>
  <div class='select-paymethod'>
  <{require file="common/paymethod.html"}>
  </div>
  <div class="textcenter" style="padding:10px;">
   <input type="submit" class='actbtn btn-pay' value="Immediate payment" />
  </div>
<{else}>
  <input type="hidden" name="payment[payment]" value="<{$order.payment}>" />
  <{if $extendInfo}>
      <div class='division paymethodextendInfo'>
      <{foreach from=$extendInfo item=item key=key}>
        <{if $item.type=='select'}>
            <select name=<{$key}>>
                <{foreach from=$item.value item=vitem key=vkey}>
                    <option value="<{$vitem.value}>" <{if $vitem.checked}>selected<{/if}>><{$vitem.name}></option>
                <{/foreach}>
            </select>
        <{else}>
            <{foreach  from=$item.value item=vitem key=vkey}>
                <{if $item.type=='radio'}>
                    <input <{$vitem.checked}> type='radio' name=<{$key}> value=<{$vitem.value}>><{if $vitem.imgname}><{$vitem.imgname}><{else}><{$vitem.name}><{/if}></if>
                <{else if $item.type=='checkbox'}>
                    <input <{$vitem.checked}> type='checkbox' name="<{$key}>[]" value=<{$vitem.value}>><{if $vitem.imgname}><{$vitem.imgname}><{else}><{$vitem.name}><{/if}></if>
                <{/if}>
            <{/foreach}>
        <{/if}>
      <{/foreach}>
      </div>
  <{/if}>
  
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="50%">
          <{if $order.amount.total > $order.amount.payed}>
            <{if $order.paytype=="OFFLINE"}>
              <div class="customMessages">{pay_offline}</strong>
            <{else}>
              <{if $order.payment==-1}><div class="customMessages">{pay_wait}</div><{else}>
              <{if $order.paytype=="DEPOSIT"}>
                <strong><{t}>You choose a pre-paid deposit<{/t}></strong>
              <{else}>
                <div class="customMessages">{pay_message}</div>
              <{/if}><{/if}>
            </td>
            </tr>
            <tr>
            <td>
			<{if $order.payment!=-1}>
            <input type="submit" class='actbtn btn-pay' value="Immediate payment" /><{/if}>
            <{/if}>
          <{else}>
             Order no longer required to pay, please wait for our address
          <{/if}>
        </td>
      </tr>
    </table>

<{/if}>
  
  </div>


</form>


<script>
        void function(){
        var form= $('f_order_pay');
            Order ={
                
                paymentChange:function(target){
                         if(!target)return;
                         target = $(target);
                     var money  = target.get('moneyamount');
                     var fmoney = target.get('formatmoney');
                     var paytype= target.get('paytype');
                     
                     $('hidden_money').set('value',money);
                     $('hidden_cur_money').set('value',money);
                     $('span_amount').set('text',fmoney);
                     form.getElement('input[type=submit]').set('value',paytype!='offline'?'Immediate payment':'OK');
                     
                     form.getElement('input[type=submit]')[(paytype=='offline'?'addClass':'removeClass')]('btn-pay-ok');
                     /* $$('#_normal_payment th .ExtendCon input[type=radio]').fireEvent('checkedchange');*/
                }
            
            };
            
            if($E('#f_order_pay .select-paymethod')){
                Order.paymentChange($E('#f_order_pay .select-paymethod input[checked]'));
                
                if(form&&form.getElement('input[type=submit]')){
                    form.getElement('input[type=submit]').addEvent('click',function(e){
                        
                        if(!$E('#f_order_pay .select-paymethod input[checked]')){
                        MessageBox.error('Please select payment method');
                        return e.stop();
                        }
                    
                    });
                }
            }
        }();
</script>
